home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-02-22 | 12.6 KB | 673 lines | [TEXT/MPS ] |
- --
- -- File: MoonbaseSenderModels.k
- -- Project: Moonbase Engine
- -- Copyright: (c) 1996 Moonbase Enterprises Pty Ltd (ACN 072 298 554)
- --
-
- class cMoonbaseSenderDummy
- is
- cSenderModel;
- has
-
- Change()
- do
- end;
-
- GetDialog()
- do
- end;
-
- GetFamily()
- do
- result := oMoonbaseSenderFamily;
- end;
-
- GetParameter()
- do
- result := "";
- end;
-
- Read(theAtomizer)
- do
- end;
-
- Weigh(theAtomizer)
- do
- end;
-
- Write(theAtomizer)
- do
- end;
-
- end;
-
- --
- -- Moonbase senders appear in the Apple Media Tool Action
- -- menu as Add Moonbase and are also available via COMMAND-3.
- -- For my requirements I have bundled both the Command
- -- and Link type senders into the one Moonbase sender.
- -- This does not cause any problems as each sender takes
- -- care of its own parameters (unlike Effect senders).
- --
-
- object oMoonbaseSenderFamily is cSenderFamily
- with
- ID is 5300;
- Tag is 'MOON';
- end;
-
- --
- -- 5390 Scroll by sender
- --
- -- Picture handler
- -- Picture Scroller handler
- -- Text handler
- -- Text Scroller handler
- --
-
- object oScrollBySenderModel is cMoonbaseSenderDummy
- has
- X; Y;
-
- Change()
- do
- self.X := oScrollBySenderDialog.X;
- self.Y := oScrollBySenderDialog.Y;
- end;
-
- Execute(theTarget)
- do
- theTarget.ScrollBy(-(self.X), -(self.Y));
- end;
-
- GetDialog(theTarget)
- do
- oScrollBySenderDialog.X := self.X;
- oScrollBySenderDialog.Y := self.Y;
- result := oScrollBySenderDialog;
- end;
-
- GetEntry()
- do
- result := oScrollBySenderEntry;
- end;
-
- GetParameter()
- do
- result := " " + self.X.ToString() + " " + self.Y.ToString();
- end;
-
- Read(theAtomizer)
- external "oScrollBySenderModelRead";
-
- SaveAsText(theStreamer, theIdentifier)
- do
- theStreamer.Echo(theIdentifier, ".ScrollBy(-(", self.X.ToString(), "), -(", self.Y.ToString(), ")); -- Moonbase Scroll by");
- end;
-
- Weigh(theAtomizer)
- external "oScrollBySenderModelWeigh";
-
- Write(theAtomizer)
- external "oScrollBySenderModelWrite";
-
- with
- X is 0;
- Y is 0;
- end;
-
- object oScrollBySenderEntry is cSenderEntry
- with
- ID is 5390;
- Tag is 'SCBY';
- end;
-
- object oScrollBySenderDialog is cAMTDialog
- has
- X; Y;
- with
- ID is 5390;
- Items is [
- cAMTTextLabel with end,
- cAMTIntegerField with Field is X; Range is [-16384, 16384]; Tag is 'PX '; end,
- cAMTTextLabel with end,
- cAMTTextLabel with end,
- cAMTIntegerField with Field is Y; Range is [-16384, 16384]; Tag is 'PY '; end,
- cAMTTextLabel with end
- ];
- X is 0;
- Y is 0;
- end;
-
- --
- -- 5391 Scroll to sender
- --
- -- Picture handler
- -- Picture Scroller handler
- -- Text handler
- -- Text Scroller handler
- --
-
- object oScrollToSenderModel is cMoonbaseSenderDummy
- has
- X; Y;
-
- Change()
- do
- self.X := oScrollToSenderDialog.X;
- self.Y := oScrollToSenderDialog.Y;
- end;
-
- Execute(theTarget)
- do
- theTarget.ScrollBy(-(self.X) - theTarget.ScrollX, -(self.Y) - theTarget.ScrollY);
- end;
-
- GetDialog(theTarget)
- do
- oScrollToSenderDialog.X := self.X;
- oScrollToSenderDialog.Y := self.Y;
- result := oScrollToSenderDialog;
- end;
-
- GetEntry()
- do
- result := oScrollToSenderEntry;
- end;
-
- GetParameter()
- do
- result := " " + self.X.ToString() + " " + self.Y.ToString();
- end;
-
- Read(theAtomizer)
- external "oScrollToSenderModelRead";
-
- SaveAsText(theStreamer, theIdentifier)
- do
- theStreamer.Echo(theIdentifier, ".ScrollBy(-(", self.X.ToString(), ") - ", theIdentifier, ".ScrollX, -(", self.Y.ToString(), ") - ", theIdentifier, ".ScrollY); -- Moonbase Scroll to");
- end;
-
- Weigh(theAtomizer)
- external "oScrollToSenderModelWeigh";
-
- Write(theAtomizer)
- external "oScrollToSenderModelWrite";
-
- with
- X is 0;
- Y is 0;
- end;
-
- object oScrollToSenderEntry is cSenderEntry
- with
- ID is 5391;
- Tag is 'SCTO';
- end;
-
- object oScrollToSenderDialog is cAMTDialog
- has
- X; Y;
- with
- ID is 5391;
- Items is [
- cAMTTextLabel with end,
- cAMTIntegerField with Field is X; Range is [-16384, 16384]; Tag is 'PX '; end,
- cAMTTextLabel with end,
- cAMTTextLabel with end,
- cAMTIntegerField with Field is Y; Range is [-16384, 16384]; Tag is 'PY '; end,
- cAMTTextLabel with end
- ];
- X is 0;
- Y is 0;
- end;
-
- --
- -- 5392 Scroll to Cell sender
- --
- -- Picture handler
- -- Picture Scroller handler
- -- Text handler
- -- Text Scroller handler
- --
-
- object oScrollToCellSenderModel is cMoonbaseSenderDummy
- has
- X; Y;
-
- Change()
- do
- self.X := oScrollToCellSenderDialog.X;
- self.Y := oScrollToCellSenderDialog.Y;
- end;
-
- Execute(theTarget)
- do
- theTarget.ScrollBy(-(self.X * theTarget.Width) - theTarget.ScrollX, -(self.Y * theTarget.Height) - theTarget.ScrollY);
- end;
-
- GetDialog(theTarget)
- do
- oScrollToCellSenderDialog.X := self.X;
- oScrollToCellSenderDialog.Y := self.Y;
- result := oScrollToCellSenderDialog;
- end;
-
- GetEntry()
- do
- result := oScrollToCellSenderEntry;
- end;
-
- GetParameter()
- do
- result := " " + self.X.ToString() + " " + self.Y.ToString();
- end;
-
- Read(theAtomizer)
- external "oScrollToCellSenderModelRead";
-
- SaveAsText(theStreamer, theIdentifier)
- do
- --
- -- I split the output into two lines and indent the second line using two
- -- inline tab characters. Using theStreamer.Return(2) messes up the formatting.
- --
- theStreamer.Echo(theIdentifier, ".ScrollBy(-(", self.X.ToString(), " * ", theIdentifier, ".Width) - ", theIdentifier, ".ScrollX, ");
- theStreamer.Return(0);
- theStreamer.Echo("\$09\$09-(", self.Y.ToString(), " * ", theIdentifier, ".Height) - ", theIdentifier, ".ScrollY); -- Scroll to Cell");
- end;
-
- Weigh(theAtomizer)
- external "oScrollToCellSenderModelWeigh";
-
- Write(theAtomizer)
- external "oScrollToCellSenderModelWrite";
-
- with
- X is 0;
- Y is 0;
- end;
-
- object oScrollToCellSenderEntry is cSenderEntry
- with
- ID is 5392;
- Tag is 'SCTC';
- end;
-
- object oScrollToCellSenderDialog is cAMTDialog
- has
- X; Y;
- with
- ID is 5392;
- Items is [
- cAMTTextLabel with end,
- cAMTIntegerField with Field is X; Range is [-16384, 16384]; Tag is 'PX '; end,
- cAMTTextLabel with end,
- cAMTTextLabel with end,
- cAMTIntegerField with Field is Y; Range is [-16384, 16384]; Tag is 'PY '; end,
- cAMTTextLabel with end
- ];
- X is 0;
- Y is 0;
- end;
-
- --
- -- 5393 Set Duration sender
- --
- -- Empty handler
- -- Color handler
- -- Picture handler
- -- Picture Scroller handler
- -- Text handler
- -- Text Scroller handler
- -- Field handler
- --
-
- object oSetDurationSenderModel is cMoonbaseSenderDummy
- has
- Time; MaximumTime;
- UseMaximumTime;
-
- Change()
- do
- self.Time := oSetDurationSenderDialog.Time;
- self.MaximumTime := oSetDurationSenderDialog.MaximumTime;
- self.UseMaximumTime := oSetDurationSenderDialog.UseMaximumTime;
- if self.UseMaximumTime then
- if self.Time > self.MaximumTime then
- self.Time := oSetDurationSenderDialog.MaximumTime;
- self.MaximumTime := oSetDurationSenderDialog.Time;
- end;
- end;
- end;
-
- Execute(theTarget)
- do
- if self.UseMaximumTime then
- theTarget.Duration := oRANDOM.Value(self.Time, self.MaximumTime);
- else
- theTarget.Duration := self.Time;
- end;
- end;
-
- GetDialog(theTarget)
- do
- oSetDurationSenderDialog.Time := self.Time;
- oSetDurationSenderDialog.MaximumTime := self.MaximumTime;
- oSetDurationSenderDialog.UseMaximumTime := self.UseMaximumTime;
- result := oSetDurationSenderDialog;
- end;
-
- GetEntry()
- do
- result := oSetDurationSenderEntry;
- end;
-
- GetParameter()
- do
- if self.UseMaximumTime then
- result := " " + self.Time.ToString() + "-" + self.MaximumTime.ToString();
- else
- result := " " + self.Time.ToString();
- end;
- end;
-
- Read(theAtomizer)
- external "oSetDurationSenderModelRead";
-
- SaveAsText(theStreamer, theIdentifier)
- do
- if self.UseMaximumTime then
- theStreamer.Echo(theIdentifier, ".Duration := oRANDOM.Value(", self.Time.ToString(), ", ", self.MaximumTime.ToString(), "); -- Set Duration");
- else
- theStreamer.Echo(theIdentifier, ".Duration := ", self.Time.ToString(), "; -- Set Duration");
- end;
- end;
-
- Weigh(theAtomizer)
- external "oSetDurationSenderModelWeigh";
-
- Write(theAtomizer)
- external "oSetDurationSenderModelWrite";
-
- with
- Time is -1;
- MaximumTime is 0;
- UseMaximumTime is false;
- end;
-
- object oSetDurationSenderEntry is cSenderEntry
- with
- ID is 5393;
- Tag is 'SEDU';
- end;
-
- object oSetDurationSenderDialog is cAMTDialog
- has
- Time; MaximumTime;
- UseMaximumTime;
- with
- ID is 5393;
- Items is [
- cAMTTextLabel with end,
- cAMTIntegerField with Field is Time; Range is [-1, 216000]; Tag is 'PTIM'; end,
- cAMTTextLabel with end,
- cAMTCheckBox with Field is UseMaximumTime; Range is [false, true]; Tag is 'PUMA'; end,
- cAMTIntegerField with Field is MaximumTime; Range is [0, 216000]; Tag is 'PMAX'; end,
- cAMTTextLabel with end
- ];
- Time is -1;
- MaximumTime is 0;
- UseMaximumTime is false;
- end;
-
- --
- -- 5394 Step by Time sender
- --
- -- Movie handler
- -- Movie Controller handler
- -- Flipbook handler
- --
-
- object oStepByTimeSenderModel is cMoonbaseSenderDummy
- has
- Time;
-
- Change()
- do
- self.Time := oStepByTimeSenderDialog.Time;
- end;
-
- Execute(theTarget)
- do
- theTarget.StepBy(self.Time);
- end;
-
- GetDialog(theTarget)
- do
- oStepByTimeSenderDialog.Time := self.Time;
- result := oStepByTimeSenderDialog;
- end;
-
- GetEntry()
- do
- result := oStepByTimeSenderEntry;
- end;
-
- GetParameter()
- do
- result := " " + self.Time.ToString();
- end;
-
- Read(theAtomizer)
- external "oStepByTimeSenderModelRead";
-
- SaveAsText(theStreamer, theIdentifier)
- do
- theStreamer.Echo(theIdentifier, ".StepBy(", self.Time.ToString(), "); -- Step by Time");
- end;
-
- Weigh(theAtomizer)
- external "oStepByTimeSenderModelWeigh";
-
- Write(theAtomizer)
- external "oStepByTimeSenderModelWrite";
-
- with
- Time is 0;
- end;
-
- object oStepByTimeSenderEntry is cSenderEntry
- with
- ID is 5394;
- Tag is 'STBY';
- end;
-
- object oStepByTimeSenderDialog is cAMTDialog
- has
- Time;
- with
- ID is 5394;
- Items is [
- cAMTTextLabel with end,
- cAMTIntegerField with Field is Time; Range is [-32768, +32768]; Tag is 'PTIM'; end,
- cAMTTextLabel with end
- ];
- Time is 0;
- end;
-
- --
- -- 5395 Use Palette of sender
- --
- -- Picture handler
- -- Picture Scroller handler
- -- Flipbook handler
- -- Button handler
- --
-
- object oUsePaletteOfSenderModel is cMoonbaseSenderDummy
- has
-
- Execute(theTarget)
- do
- theTarget.Supplier.UpdateLoadedData();
- end;
-
- GetEntry()
- do
- result := oUsePaletteOfSenderEntry;
- end;
-
- SaveAsText(theStreamer, theIdentifier)
- do
- theStreamer.Echo(theIdentifier, ".Supplier.UpdateLoadedData(); -- Use Palette of");
- end;
-
- end;
-
- object oUsePaletteOfSenderEntry is cSenderEntry
- with
- ID is 5395;
- Tag is 'UPOF';
- end;
-
- --
- -- 5396 All Links Merge sender
- --
- -- container
- --
-
- object oAllLinksMergeSenderModel is cMoonbaseSenderDummy
- has
-
- Execute(theTarget)
- do
- theTarget.Binder.EachUp(Merge, theTarget);
- end;
-
- GetEntry()
- do
- result := oAllLinksMergeSenderEntry;
- end;
-
- SaveAsText(theStreamer, theIdentifier)
- do
- theStreamer.Echo("oBinder.EachUp(Merge, ", theIdentifier, "); -- All Links Merge");
- end;
-
- end;
-
- object oAllLinksMergeSenderEntry is cSenderEntry
- with
- ID is 5396;
- Tag is 'ALKM';
- end;
-
- --
- -- 5397 Pop Link sender
- --
- -- binder
- --
-
- object oPopLinkSenderModel is cMoonbaseSenderDummy
- has
-
- Execute(theTarget)
- do
- if theTarget.Count() > 0 then
- theTarget.Pop();
- end;
- end;
-
- GetEntry()
- do
- result := oPopLinkSenderEntry;
- end;
-
- SaveAsText(theStreamer, theIdentifier)
- do
- --
- -- I had intended this to be a one liner but popping an empty collection
- -- causes serious crash. Normally you would only pop items that you had
- -- pushed onto the stack but in this open environment we can not keep
- -- track of pushes. We now check for one or more items before popping!
- --
- theStreamer.Echo("if ", theIdentifier, ".Count() > 0 then");
- theStreamer.Return(1);
- theStreamer.Echo(theIdentifier, ".Pop(); -- Pop Link");
- theStreamer.Return(-1);
- theStreamer.Echo("end;");
- end;
-
- end;
-
- object oPopLinkSenderEntry is cSenderEntry
- with
- ID is 5397;
- Tag is 'POLK';
- end;
-
- --
- -- 5398 Pop All Links sender
- --
- -- binder
- --
-
- object oPopAllLinksSenderModel is cMoonbaseSenderDummy
- has
-
- Execute(theTarget)
- do
- theTarget.Empty();
- end;
-
- GetEntry()
- do
- result := oPopAllLinksSenderEntry;
- end;
-
- SaveAsText(theStreamer, theIdentifier)
- do
- theStreamer.Echo(theIdentifier, ".Empty(); -- Pop All Links");
- end;
-
- end;
-
- object oPopAllLinksSenderEntry is cSenderEntry
- with
- ID is 5398;
- Tag is 'PALK';
- end;
-
- --
- -- 5399 Push Link sender
- --
- -- container
- --
-
- object oPushLinkSenderModel is cMoonbaseSenderDummy
- has
-
- Execute(theTarget)
- do
- theTarget.Binder.Push(theTarget);
- end;
-
- GetEntry()
- do
- result := oPushLinkSenderEntry;
- end;
-
- SaveAsText(theStreamer, theIdentifier)
- do
- theStreamer.Echo("oBinder.Push(", theIdentifier, "); -- Push Link");
- end;
-
- end;
-
- object oPushLinkSenderEntry is cSenderEntry
- with
- ID is 5399;
- Tag is 'PULK';
- end;
-